package ar.camera.thread;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import ar.globals.Globals;

public class RouteUIThread implements Runnable {

	private Handler handler;

	public RouteUIThread(Handler handler, Context ct) {
		super();
		this.handler = handler;
	}

	@Override
	public void run() {
		while (true) {
			if (!Globals.isFinishedARRoute) {
				if (Globals.isNeedUpdatedRouteCompass) {
					Globals.isNeedUpdatedRouteCompass = false;
					Message msg = handler.obtainMessage(
							Globals.UPDATE_ROUTE_COMPASS, null);
					handler.sendMessage(msg);
				}
			} else {
				break;
			}
		}
	}
}